package com.ns.attendance.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.ns.attendance.dao.BaseDao;

@Transactional
public abstract class BaseService<T,ID extends Serializable>{

	public abstract BaseDao<T,ID> getDefaultDao();
	
	@Transactional(readOnly=true)
	public List<T> findAll(){
		return getDefaultDao().findAll();
	}
	@Transactional(readOnly = true)
	public T get(ID id){
		return  getDefaultDao().get(id);
	}
	@Transactional
	public Serializable save(T t){
		return getDefaultDao().save(t);
	}
	@Transactional
	public void update(T t){
		getDefaultDao().update(t);
	}
	
}
